#ifndef LOG_H
#define LOG_H

#pragma once

namespace minic {

#include <cstdio>
#include <cstdarg>
#include <string>
#include "logprint.h"

class Endl {};

class CCout {
public:
    CCout& operator<<(int value) {
        LOG_PRINT("%d", value);
        return *this;
    }

    CCout& operator<<(long value) {
        LOG_PRINT("%ld", value);
        return *this;
    }

    CCout& operator<<(unsigned int value) {
        LOG_PRINT("%u", value);
        return *this;
    }

    CCout& operator<<(unsigned long value) {
        LOG_PRINT("%lu", value);
        return *this;
    }

    CCout& operator<<(float value) {
        LOG_PRINT("%f", value);
        return *this;
    }

    CCout& operator<<(double value) {
        LOG_PRINT("%f", value);
        return *this;
    }

    CCout& operator<<(long double value) {
        LOG_PRINT("%Lf", value);
        return *this;
    }

    CCout& operator<<(char value) {
        LOG_PRINT("%c", value);
        return *this;
    }

    CCout& operator<<(const char* value) {
        LOG_PRINT("%s", value);
        return *this;
    }

    CCout& operator<<(const std::string &value) {
        LOG_PRINT("%s", value.c_str());
        return *this;
    }


    CCout& operator<<(bool value) {
        if (value) {
            LOG_PRINT("true");
        } else {
            LOG_PRINT("false");
        }
        return *this;
    }

    CCout& operator<<(Endl &endl) {
        LOG_PRINT("\n");
        return *this;
    }
};


class CCerr {
public:
    CCerr& operator<<(int value) {
        LOG_ERR_PRINT("%d", value);
        return *this;
    }

    CCerr& operator<<(long value) {
        LOG_ERR_PRINT("%ld", value);
        return *this;
    }

    CCerr& operator<<(unsigned int value) {
        LOG_ERR_PRINT("%u", value);
        return *this;
    }

    CCerr& operator<<(unsigned long value) {
        LOG_ERR_PRINT("%lu", value);
        return *this;
    }

    CCerr& operator<<(float value) {
        LOG_ERR_PRINT("%f", value);
        return *this;
    }

    CCerr& operator<<(double value) {
        LOG_ERR_PRINT("%f", value);
        return *this;
    }

    CCerr& operator<<(long double value) {
        LOG_ERR_PRINT("%Lf", value);
        return *this;
    }

    CCerr& operator<<(char value) {
        LOG_ERR_PRINT("%c", value);
        return *this;
    }

    CCerr& operator<<(const char* value) {
        LOG_ERR_PRINT("%s", value);
        return *this;
    }

    CCerr& operator<<(const std::string &value) {
        LOG_ERR_PRINT("%s", value.c_str());
        return *this;
    }


    CCerr& operator<<(bool value) {
        if (value) {
            LOG_ERR_PRINT("true");
        } else {
            LOG_ERR_PRINT("false");
        }
        return *this;
    }

    CCerr& operator<<(Endl &endl) {
        LOG_ERR_PRINT("\n");
        return *this;
    }
};

extern CCout cout;
extern CCerr cerr;
extern Endl endl;



}

#endif